import apibase from "@/api/apiBase";
import axios from "axios";
import { addInterface, editInterface } from "./channel.interface";

//一级渠道
export const $oneChannelList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/list',
    data: params,
    instance,
  });
}

//二级渠道
export const $twoChannelList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/getSecondList',
    data: params,
    instance,
  });
}


//三级渠道
export const $threeChannelList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/getThirdList',
    data: params,
    instance,
  });
}

//渠道详情
export const $channelDetail = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/detail',
    data: params,
    instance,
  });
}

//一级渠道添加
export const $channelAdd = (params: addInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/channel/add',
    data: params,
    instance,
  });
}

//二级渠道添加
export const $channelAddSecond = (params: addInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/channel/addSecond',
    data: params,
    instance,
  });
}

//三级渠道添加
export const $channelAddThird = (params: addInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/channel/addThird',
    data: params,
    instance,
  });
}
//渠道详情
export const $channelEdit = (params: editInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/channel/edit',
    data: params,
    instance,
  });
}


//渠道重置密码
export const $channelResetPassword = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/channelAdmin/resetPassword',
    data: params,
    instance,
  });
}

//二级渠道二维码
export const $generateQRcode = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/generateQRcode',
    data: params,
    instance,
  });
}

//三级渠道二维码
export const $generateSecondQRcode = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/channel/generateSecondQRcode',
    data: params,
    instance,
  });
}

//推广业绩
export const $salerAchievementList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/salerAchievement/list',
    data: params,
    instance,
  });
}

//个人业绩
export const $salerAchievementSalerOrder = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/salerAchievement/salerOrder',
    data: params,
    instance,
  });
}





